package com.fozu.office.order.service;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fozu.office.order.dao.OrderDao;
import com.fozu.office.order.entity.OrderVO;

@Service
@Transactional(readOnly=true)
public class OrderService {

	
	@Autowired
	OrderDao orderDao;
	/*
	 * 添加订单
	 */
	@Transactional(readOnly=false)
	public void addOrder(OrderVO orderVO){
		orderDao.addOrder(orderVO);
		
	}
	/*
	 * 根据id删除订单
	 */
	@Transactional(readOnly=false)
	public void deleteOrder(OrderVO orderVO){
		orderDao.deleteOrderByid(orderVO);
	}
	/*
	 * 查询订单
	 */
	public OrderVO getAllOrder(OrderVO orderVO){
		return orderDao.getAllOrder(orderVO);
	}
	/*
	 * 修改订单
	 */
	@Transactional(readOnly=false)
	public void updateOrder(OrderVO orderVO){
		orderDao.updateOrder(orderVO);
	}
	/*
	 * 根据id获取订单信息
	 */
	public OrderVO getOrderbyId(OrderVO orderVO){
		 return orderDao.getOrderbyId(orderVO);
	}

	public IPage<OrderVO> listOrder(Page<OrderVO> page,
			@Param(value = "order") OrderVO orderVO){
		return orderDao.listOrder(page, orderVO);
	}
}
